package com.xq.springboot.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author xq
 * @version 1.0
 * @date 2021/4/16 12:16
 * @description 学生实体类1
 * @Value注解是读取properties或yml文件的属性的值  配置写在properties，map集合取不到
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
public class Student1 {
    @Value("${student.id}")
    private Integer id;
    @Value("${student.name}")
    private String name;
//    @Value("${student.hobby}")
//    private String[] hobby;
//    @Value("${student.list}")
//    private List<String> list;
//    @Value("${student.map}")
//    private Map<String, Object> map;
//    @Value("${student.set}")
//    private Set<Object> set;
    @Value("${student.age}")
    private Integer age;
    @Value("${student.birth}")
    private Date birth;
}
